package day05.ti.ObjectDome;

public class Student {
    private String pp;
    private String color;
    private double jg;

    public Student() {
    }

    public Student(String pp, String color, double jg) {
        this.pp = pp;
        this.color = color;
        this.jg = jg;
    }

    public String getPp() {
        return pp;
    }

    public void setPp(String pp) {
        this.pp = pp;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getJg() {
        return jg;
    }

    public void setJg(double jg) {
        this.jg = jg;
    }

    @Override
    public String toString() {
        return "Student{" +
                "pp='" + pp + '\'' +
                ", color='" + color + '\'' +
                ", jg=" + jg +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        if (Double.compare(student.jg, jg) != 0) return false;
        if (pp != null ? !pp.equals(student.pp) : student.pp != null) return false;
        return color != null ? color.equals(student.color) : student.color == null;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = pp != null ? pp.hashCode() : 0;
        result = 31 * result + (color != null ? color.hashCode() : 0);
        temp = Double.doubleToLongBits(jg);
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }
}
